/*
 * XML Type:  PaymentSyncResponse
 * Namespace: http://ofx.net/types/2003/04
 * Java type: net.ofx.types.x2003.x04.PaymentSyncResponse
 *
 * Automatically generated - do not modify.
 */
package net.ofx.types.x2003.x04.impl;
/**
 * An XML PaymentSyncResponse(@http://ofx.net/types/2003/04).
 *
 * This is a complex type.
 */
public class PaymentSyncResponseImpl extends net.ofx.types.x2003.x04.impl.AbstractSyncResponseImpl implements net.ofx.types.x2003.x04.PaymentSyncResponse
{
    
    public PaymentSyncResponseImpl(org.apache.xmlbeans.SchemaType sType)
    {
        super(sType);
    }
    
    private static final javax.xml.namespace.QName BANKACCTFROM$0 = 
        new javax.xml.namespace.QName("", "BANKACCTFROM");
    private static final javax.xml.namespace.QName PMTTRNRS$2 = 
        new javax.xml.namespace.QName("", "PMTTRNRS");
    
    
    /**
     * Gets the "BANKACCTFROM" element
     */
    public net.ofx.types.x2003.x04.BankAccount getBANKACCTFROM()
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.BankAccount target = null;
            target = (net.ofx.types.x2003.x04.BankAccount)get_store().find_element_user(BANKACCTFROM$0, 0);
            if (target == null)
            {
                return null;
            }
            return target;
        }
    }
    
    /**
     * Sets the "BANKACCTFROM" element
     */
    public void setBANKACCTFROM(net.ofx.types.x2003.x04.BankAccount bankacctfrom)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.BankAccount target = null;
            target = (net.ofx.types.x2003.x04.BankAccount)get_store().find_element_user(BANKACCTFROM$0, 0);
            if (target == null)
            {
                target = (net.ofx.types.x2003.x04.BankAccount)get_store().add_element_user(BANKACCTFROM$0);
            }
            target.set(bankacctfrom);
        }
    }
    
    /**
     * Appends and returns a new empty "BANKACCTFROM" element
     */
    public net.ofx.types.x2003.x04.BankAccount addNewBANKACCTFROM()
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.BankAccount target = null;
            target = (net.ofx.types.x2003.x04.BankAccount)get_store().add_element_user(BANKACCTFROM$0);
            return target;
        }
    }
    
    /**
     * Gets array of all "PMTTRNRS" elements
     */
    public net.ofx.types.x2003.x04.PaymentTransactionResponse[] getPMTTRNRSArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            java.util.List targetList = new java.util.ArrayList();
            get_store().find_all_element_users(PMTTRNRS$2, targetList);
            net.ofx.types.x2003.x04.PaymentTransactionResponse[] result = new net.ofx.types.x2003.x04.PaymentTransactionResponse[targetList.size()];
            targetList.toArray(result);
            return result;
        }
    }
    
    /**
     * Gets ith "PMTTRNRS" element
     */
    public net.ofx.types.x2003.x04.PaymentTransactionResponse getPMTTRNRSArray(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.PaymentTransactionResponse target = null;
            target = (net.ofx.types.x2003.x04.PaymentTransactionResponse)get_store().find_element_user(PMTTRNRS$2, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            return target;
        }
    }
    
    /**
     * Returns number of "PMTTRNRS" element
     */
    public int sizeOfPMTTRNRSArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(PMTTRNRS$2);
        }
    }
    
    /**
     * Sets array of all "PMTTRNRS" element
     */
    public void setPMTTRNRSArray(net.ofx.types.x2003.x04.PaymentTransactionResponse[] pmttrnrsArray)
    {
        synchronized (monitor())
        {
            check_orphaned();
            arraySetterHelper(pmttrnrsArray, PMTTRNRS$2);
        }
    }
    
    /**
     * Sets ith "PMTTRNRS" element
     */
    public void setPMTTRNRSArray(int i, net.ofx.types.x2003.x04.PaymentTransactionResponse pmttrnrs)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.PaymentTransactionResponse target = null;
            target = (net.ofx.types.x2003.x04.PaymentTransactionResponse)get_store().find_element_user(PMTTRNRS$2, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            target.set(pmttrnrs);
        }
    }
    
    /**
     * Inserts and returns a new empty value (as xml) as the ith "PMTTRNRS" element
     */
    public net.ofx.types.x2003.x04.PaymentTransactionResponse insertNewPMTTRNRS(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.PaymentTransactionResponse target = null;
            target = (net.ofx.types.x2003.x04.PaymentTransactionResponse)get_store().insert_element_user(PMTTRNRS$2, i);
            return target;
        }
    }
    
    /**
     * Appends and returns a new empty value (as xml) as the last "PMTTRNRS" element
     */
    public net.ofx.types.x2003.x04.PaymentTransactionResponse addNewPMTTRNRS()
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.PaymentTransactionResponse target = null;
            target = (net.ofx.types.x2003.x04.PaymentTransactionResponse)get_store().add_element_user(PMTTRNRS$2);
            return target;
        }
    }
    
    /**
     * Removes the ith "PMTTRNRS" element
     */
    public void removePMTTRNRS(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(PMTTRNRS$2, i);
        }
    }
}
